Skip to content

initramfs: tolerate pre-existing /run/systemd/volatile-root symlink#2276

Merged
Johan-Liebert1 merged 1 commit into
bootc-dev:mainfrom
ricardosalveti:volatile-root-eexist
Jul 8, 2026
Merged

initramfs: tolerate pre-existing /run/systemd/volatile-root symlink#2276
Johan-Liebert1 merged 1 commit into
bootc-dev:mainfrom
ricardosalveti:volatile-root-eexist

Conversation

@ricardosalveti

Copy link
Copy Markdown
Contributor

ostree-prepare-root is growing the same gpt-auto workaround for composefs roots (creating the /run/systemd/volatile-root symlink so systemd's blockdev_get_root() can resolve the backing device, see systemd/systemd#35017), proposed in ostreedev/ostree#3608. It runs before bootc-root-setup.service, so once that lands the symlink already exists by the time gpt_workaround() runs, and the unconditional symlink() call makes the service fail.

Both creators point the symlink at the /dev/block/MAJ:MIN alias of the same physical root device, so simply ignore EEXIST, matching how ensure_dir() handles already-existing directories.

ostree-prepare-root is growing the same gpt-auto workaround for
composefs roots (creating the /run/systemd/volatile-root symlink so
systemd's blockdev_get_root() can resolve the backing device, see
systemd/systemd#35017), proposed in
ostreedev/ostree#3608. It runs before
bootc-root-setup.service, so once that lands the symlink already
exists by the time gpt_workaround() runs, and the unconditional
symlink() call makes the service fail.

Both creators point the symlink at the /dev/block/MAJ:MIN alias of the
same physical root device, so simply ignore EEXIST, matching how
ensure_dir() handles already-existing directories.

Signed-off-by: Ricardo Salveti <[email protected]>
@bootc-bot bootc-bot Bot requested a review from henrywang July 3, 2026 03:05

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

(That said, not related to your PR but I think what we really want to do is actually add the overlayfs API to query backing layers)

@cgwalters cgwalters added this pull request to the merge queue Jul 6, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 7, 2026
Comment thread crates/initramfs/src/lib.rs
@ricardosalveti

Copy link
Copy Markdown
Contributor Author

Doesn't look like the CI failures are related to this change.

@Johan-Liebert1 Johan-Liebert1 added this pull request to the merge queue Jul 8, 2026
Merged via the queue into bootc-dev:main with commit 1e92b77 Jul 8, 2026
18 checks passed
cgwalters pushed a commit to cgwalters/composefs-rs that referenced this pull request Jul 9, 2026
ostree-prepare-root is growing the same gpt-auto workaround for
composefs roots (creating the /run/systemd/volatile-root symlink so
systemd's blockdev_get_root() can resolve the backing device, see
systemd/systemd#35017), proposed in
ostreedev/ostree#3608. When it runs before
composefs-setup-root, the symlink already exists by the time
gpt_workaround() runs and the unconditional symlink() call fails with
EEXIST. The call site discards the error ("best effort"), but an
already existing symlink means the desired end state is in place, so
treat it as success rather than an error.

This matches the equivalent change to bootc's vendored copy of this
code in bootc-dev/bootc#2276.

Signed-off-by: Ricardo Salveti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants